#ifndef TRSOCKET_H
#define TRSOCKET_H

#include <QSsl>
#include <QObject>
#include <QSslKey>
#include <QSslError>
#include <QTcpServer>
#include <QTcpSocket>
#include <QSslSocket>
#include <QSslCipher>
#include <QSslCertificate>
#include <QSslConfiguration>

class CTrSocket : public QObject
{
    Q_OBJECT
public:
    CTrSocket();
    void setupSocketInit(QString ip, unsigned short port, QString ca);
signals:

public slots:
    void updateEnabledState();
    void secureConnect();
    void socketStateChanged(QAbstractSocket::SocketState state);
    void socketEncrypted();
    void socketReadyRead();
    void sendData();
    void socketError(QAbstractSocket::SocketError error);
    void sslErrors(const QList<QSslError> &errors);
    void displayCertificateInfo();
private:
    QSslSocket*     m_pSocket = nullptr;
};

#endif // TRSOCKET_H
